Open Bug 1410810 Opened 8 years ago Updated 2 years ago

Allow to copy relative XPath of an element

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(firefox58 affected)

Tracking Status
firefox58 --- affected

People

(Reporter: sebo, Unassigned)

References

(Blocks 1 open bug, )

Details

Bug 987877 added an option to copy the XPath of an element. This option only allows to copy the absolute XPath, though. The Firebug extension FirePath and the Chrome DevTools allow to copy a relative XPath, though, which is better suited when the document structure changes regularily. Therefore the current option should be changed to create a relative XPath where possible. If there's a use case for copying the full XPath, there might also be a new option "Relative XPath" be added in addition to the current "XPath" option. Example: Copying the XPath for the <p> element containing "bar" from data:text/html,<div id="foo"><p>bar</p></div>. Result: Firefox DevTools: /html/body/div/p Chrome DevTools: //*[@id="foo"]/p Firepath: .//*[@id='foo']/p Sebastian
Severity: normal → enhancement
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.